package com.corechina.apex_osswords.domain.vo;

import com.corechina.apex_osswords.common.Constant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class SysLoginInfoVo {
    private String token;

    private Integer userId;

    private String userName;

    private Integer loginType;

    private Integer groupId;

    private Integer deptId;

    private String groupName;

    private Integer seeAll;

    private Integer needEditPwd = 0;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mms:ss")
    private Date expireTime;

    private Integer enterpriseId;

    public SysLoginInfoVo(){

    }

    public SysLoginInfoVo(String token, SysLoginInfoVo sysLoginInfoVo, Date expireTime){
        this.token = token;
        this.userId = sysLoginInfoVo.getUserId();
        this.userName = sysLoginInfoVo.getUserName();
        this.groupId = sysLoginInfoVo.getGroupId();
        this.deptId = sysLoginInfoVo.getDeptId();
        this.groupName = sysLoginInfoVo.getGroupName();
        this.seeAll = sysLoginInfoVo.getSeeAll();
        this.needEditPwd = sysLoginInfoVo.getNeedEditPwd();
        this.enterpriseId = sysLoginInfoVo.getEnterpriseId();
        this.expireTime = expireTime;
        this.loginType = Constant.LoginType.CLIENT_LOGIN.getCode();
    }
}
